package com.briup.day06;

/**
 * @author ThinkBook
 */
public class Test03_Random {
    //小芳存钱
    public static void main(String[] args) {
        //定义天数【计数器】
        int count = 0;

        //sum: 存钱总值
        double sum = 0;
        while(true) {
            count++;

            if(count % 5 == 0) {
                sum -= 6;
            }

            sum += 2.5;
            System.out.println("第 " + count + " 天，存钱: " + sum);

            //break可以 结束循环
            if(sum >= 100) {
                break;
            }
        }
        System.out.println("经历天数: " + count);
        System.out.println("sum: " + sum);
    }

    public static void main01(String[] args) {
        int count = 0;
        int num;
        do {
            count ++;
            num = (int)(Math.random() * (20-10+1))+10;
            System.out.println("in dowhile num:" + num);
        }while (num !=15);
        System.out.println("after dowhile num:" + num);
        System.out.println(count);
    }
}
